<template>
	<Theme>
		<Detail>
			<view class="fdc fac bgw mt2">
				<view class="h12"/>
				<view class="fac twb">
					<u-icon name="checkmark-circle-fill" class="fc-success fs46" />
					<text class="fc-success ml2 fs44">{{view.tips}}</text>
				</view>
				<view v-if="view.desc" class="w60 tac c9 mt6">{{view.desc}}</view>
			</view>
			<view class="h8 bgw"/>
			<view class="px8 bgw fjc">
				<button v-if="view.back" type="default" class="mx8" @click="back(view.back)">返回</button>
				<button v-else type="default" class="mx8" @click="back(view.home)">返回主页</button>
				<button v-if="querys.id" type="primary" class="mx8" @click="rdrto(view.route,{id:querys.id})">{{view.label}}</button>
				<button v-else-if="view.route" type="primary" class="mx8" @click="rdrto(view.route)">{{view.label}}</button>
			</view>
			<view class="h8 bgw"/>
			<view class="mt2">
				<view class="py6 tac bgw">精选推荐</view>
				<view class="fww" v-if="loadstate==2">
					<view @click="navto('item/view', {id:item.id})" class="col-2 bgw mt3 br3 fdc" v-for="(item, i) in hobbyList" :key="i">
						<image :lazy-load="true" :src="filter.image(item.thumb)" class="wt h36 br3"/>
						<view class="px4 h8 tl2 pt2">【{{filter.country(item.home)}}】{{item.name}}{{item.spec}}</view>
						<view class="fc-green fs34 py2 px4"><text class="fs20">￥</text>{{filter.number(item.price/100)}}</view>
					</view>
				</view>
			</view>
		</Detail>
	</Theme>
</template>
<script lang="ts">
import {page,form} from '@/mixins'
import util from '@/utils/util'

const types = {
		agent: {tips: '提交成功,等待审核', desc: '审核需要1-3个工作日,请耐心等待', home: 'agent/index', route:'agent/profile/view', label: '查看详情'},
		supplier: {tips: '提交成功,等待审核', desc: '审核需要1-3个工作日,请耐心等待', home: 'supplier/index', route:'supplier/profile/view', label: '查看详情'},
		mch_bankcard: {tips: '提交成功,等待审核', desc: '审核需要1-3个工作日,请耐心等待', home: 'my', route:'mch/bankcard/view', label: '查看详情'},
		bankcard: {tips: '提交成功,等待审核', desc: '审核需要1-3个工作日,请耐心等待', home: 'my', route:'courier/bankcard/view', label: '查看详情'},
		root: {tips: '提交成功,等待审核', desc:'审核需要一段时间,请耐心等待', home: 'matter/root/index', route:'matter/root/index?exam=1', label: '商品列表'},
		item: {tips: '提交成功,等待审核', desc:'审核需要一段时间,请耐心等待', home: 'matter/item/index', route:'matter/item/index?exam=1', label: '规格明细'},
		comment: {tips: '评价成功', home: 'my', desc:'', label: '评价'},
		store_item: {tips: '发布成功,等待审核', desc:'审核需要需要一段时间,请耐心等待', home: 'store/index', route:'store/item/index?exam=1', label: '商品列表'},
		store: {tips: '提交成功,等待审核', desc: '审核需要1-3个工作日,请耐心等待', home: 'store/index', route:'store/profile/view', label: '查看详情'},
		team: {tips: '提交成功,等待审核', desc: '审核需要一段时间,请耐心等待', home: 'my', route:'my/team/view', label: '查看详情'},
		mall_send: {tips: '发货成功', desc:'', home: 'store/index', route:'store/sell/order/index?state=2', label: '订单列表'},
		mall_refund: {tips: '提交成功', desc:'请耐心等待商家审核', home: 'my', route:'my/refund/index', label: '退款列表'},
		stob_refund: {tips: '提交成功', desc:'请耐心等待供应商审核', home: 'store/index', route:'store/buy/refund/index', label: '退款列表'},
		import: {tips: '提交成功,等待审核', desc: '审核需要一段时间,请耐心等待', home: 'store/index', route: 'store/stock/import/index', label: '入库单列表'},
		export: {tips: '出库成功', home: 'store/index', route: 'store/stock/export/index', label: '出库单'},
		remit: {tips: '提交成功,等待审核', desc:'供应商需要审核汇款到账情况,审核时间为1-3个工作日,请耐心等待', home: 'store/index', route:'store/buy/remit/view', label: '查看详情'},
		stob_item: {tips: '发布成功,等待审核', desc:'审核需要1-3个工作日,请耐心等待', home: 'store/index', route:'supplier/item/index?exam=1', label: '商品列表'},
		stob_send: {tips: '发货成功', desc:'', home: 'supplier/index', route:'supplier/order/index?state=3', label: '订单列表'},
		courier: {tips: '提交成功,等待审核', desc: '审核需要1-3个工作日,请耐心等待', home: 'my', route:'courier/profile/view', label: '查看详情'}
}

export default
{
	mixins: [page,form],
	data() {
		return {
			hobbyList: [],
			loadPath: 'index/hots',
			querys: {type: 0, id: 0}
		}
	},
	computed: {
		view(){
			return types[this.querys.type || 'root']
		}
	}
}
</script>
